package palf.commands {
import palf.menu.Menu;
import palf.menuItems.MenuItem;

internal class MenuNavigationCommand implements Command {

	private var menu : Menu;
	private var content : Vector.<MenuItem>;

	public function MenuNavigationCommand(menu : Menu, content : Vector.<MenuItem>) {
		this.menu = menu;
		this.content = content;
	}

	public function execute() : void {
		menu.clearItems();
		for each (var item : MenuItem in content) {
			menu.addItemAt(item);
		}
		menu.sort();
	}

}

}
